/*
package com.wgj.android.fragment;

import android.content.Context;
import android.graphics.Color;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v4.content.ContextCompat;
import android.support.v7.widget.DividerItemDecoration;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.jiaai.xui.adapter.XRecyclerViewAdapter;
import com.jiaai.xui.adapter.XViewHolder;
import com.jiaai.xui.adapter.decoration.DividerDecoration;
import com.jiaai.xui.utils.XDateUtils;
import com.jiaai.xui.utils.XDensityUtils;
import com.jiaai.xui.utils.http.HttpCallBack;
import com.jiaai.xui.utils.http.ListHttpCallBack;
import com.jiaai.xui.utils.http.XHttp;
import com.wgj.android.R;
import com.wgj.android.entity.QDHS;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import butterknife.BindView;
import butterknife.ButterKnife;

*/
/**
 * Created by Administrator on 2018/1/31.
 *//*


public class QdHSFragment extends Fragment {
   private Context mContext;
    @BindView(R.id.notDataView)
    View notDataView;

   @BindView(R.id.list_view)
    RecyclerView listView;

    private  List<QDHS> qdhsArrayList=new ArrayList<>();
    private XRecyclerViewAdapter<QDHS> deliverAdapter;


    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        View view=inflater.inflate(R.layout.qd_hs_fragment,container,false);
        ButterKnife.bind(this,view);
        initView();
        return view;
    }
    private void  initView(){
        deliverAdapter=new XRecyclerViewAdapter<QDHS>(listView,qdhsArrayList,R.layout.qd_hs_item) {
            @Override
            protected void bindData(XViewHolder viewHolder, QDHS qdhs, int i) {
                viewHolder.setImageUrl(R.id.avater,qdhs.getAvater());
                viewHolder.setText(R.id.nickName,qdhs.getM_nick());
                viewHolder.setText(R.id.money,qdhs.getTake_money().toString());
            }
        };
        listView.setLayoutManager(new LinearLayoutManager(getContext()));
        listView.setHasFixedSize(true);
        listView.addItemDecoration(new DividerDecoration(ContextCompat.getColor(getContext(),R.color.transparent), XDensityUtils.dp2px(5f)));
        listView.setAdapter(deliverAdapter);
        getData(XDateUtils.format(new Date(),"yyyy-MM-dd"));

    }

    public  void  getData(String times){
        XHttp.obtain().get("http://192.168.1.117:8888/api/v1/admin/HB/seachSignHBRecord?times="+times, null, new ListHttpCallBack<QDHS>() {
            @Override
            public void onSuccess(List<QDHS> qdhs) {
                 if(qdhs.size()==0){
                     notDataView.setVisibility(View.VISIBLE);
                     listView.setVisibility(View.GONE);
                 }else {
                     listView.setVisibility(View.VISIBLE);
                     notDataView.setVisibility(View.GONE);
                     qdhsArrayList.clear();
                     qdhsArrayList.addAll(qdhs);
                     deliverAdapter.notifyDataSetChanged();
                 }
            }
            @Override
            public void onFailed(int i, String s, boolean b) {
                listView.setVisibility(View.GONE);
                notDataView.setVisibility(View.VISIBLE);
            }
        });
    }

    @Override
    public void onAttach(Context context) {
        super.onAttach(context);
        mContext=context;
    }
}
*/
